package com.jxdinfo.hussar.example.bpmvisitor.qjgl.bpmqjsqlc.bpmqjsqlc1;

import com.jxdinfo.hussar.formdesign.formdesign.visitor.HussarBpmVariablesVisitor;
import org.springframework.stereotype.Component;
import com.jxdinfo.hussar.example.qjgl.ryqjsjmx.model.Ryqjsjmx;
import com.jxdinfo.hussar.example.qjgl.ryqjsjmx.service.RyqjsjmxService;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Component(value = "bpm_qjsqlc:1hussar_5")
public class Bpmqjsqlc1Hussar_5Visitor implements HussarBpmVariablesVisitor {

    @Resource
    private RyqjsjmxService ryqjsjmxService;

    @Override
    public Map<String, Object> visit(String businessId) {
        //查询所需对象
        Ryqjsjmx ryqjsjmx = ryqjsjmxService.formQuery(businessId).getData();
        ryqjsjmx = ryqjsjmx != null ? ryqjsjmx : new Ryqjsjmx();
        //将所找属性放到map中传递
        Map<String, Object> map = new HashMap<>();
        map.put("days",ryqjsjmx.getDays());
        return map;
    }
}
